Differential equation models

Today we'll look at differential equation models, which are

  1. deterministic (not random), and
  2. continuous-time.

Both of these are approximations, at least at some level, but provide a very useful big-picture look at how a model "ought to behave".

The logistic model

Last time we studied a model of logistic population growth. Reparameterizing a bit, in this model the population size at time step $k$, denoted $N_k$, satisfies $$\begin{aligned} N_{k+1} - N_k &= N_k \left( \lambda - \mu - \frac{\lambda N_k}{K} \right) + \epsilon, \end{aligned}$$ where

Imagine our first model was very coarse-grained: we'd defined one "time step" to be 100 years, and now we want to refine it, using the "same" model, but with one time step equal to one year. To do this, we'd need to:

The carrying capacity would stay the same, and the variance of $\epsilon$ would decrease along with the number of births and deaths per time step.

Let's say instead that one original time step is one "unit of time", that we now break up into $T$ time steps. Then, the equation above is: $$\begin{aligned} N_{t+1/T} - N_t &= \frac{1}{T} N_t \left( \lambda - \mu - \frac{\lambda N_t}{K} \right) + \epsilon . \end{aligned}$$

The first idea of how this should behave comes from by ignoring noise (setting $\epsilon = 0$). Then, multiplying by $T$ and taking $T \to \infty$ (the limit of small time steps), we end up with the logistic equation, $$\begin{aligned} \frac{d}{dt} N_t &= N_t \left( \lambda - \mu - \frac{\lambda N_t}{K} \right). \end{aligned}$$ (Well, it's the logistic equation we'd find on Wikipedia if we set $r = \lambda - \mu$ and change $K$ to $K r / \lambda$.)

Solving differential equations can be done with scipy.integrate. How's this differ from iterating the discrete, deterministic equation? Not much, in this case.

Exercise

Compare the solution to the differential equation to iteration of the deterministic equation we had before: